package com.woniuxy.yoga.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @package_name: com.woniuxy.yoga.config
 * @Author: ligang
 * @time: 2020/10/31 11:32
 **/
public class AlipayConfig {
    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000116658257";

    //2021000116658257
    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCgV/nFTn7AEVjQaUla7Y0SpRbfUCiPtPQUAyk1mgDYkNzwD9vWoBk4ZBYhBdM/z++lPkrtxEXyW4/ZJYDDDuZU1SZJYbEkkZ368HVrPRQc+jB6Dk0VGkq/dnYeRtjp8IY45UYE+uL36g+4NM/UeOpnyal7/lKANYsvpmZr2E3JB/rm3AJuXJBvZlFbbOJb0D/lwtPceliughQekRsZiPTDWaHPI75d7cvgdaUP7Ijzg+Li+Sq/BuNA2FocJe7YU8Fc4BWU8hX0v25tXuuOytWUxSxB/+6RjOaNlGURW6C0uPMpmXvTR5fSoONSjl4D8IFnGsCrrnbMHXk5I36hVu5XAgMBAAECggEAew1pEsG9xjrJ1Q+oCw8ZX8Cwf+qtZjPxyNXwL0Gj+o+Z7uXMybaOBFfTH76vs14pxL+8kyI4p9ka2QPOAGQT4fC+dDxzzOOvwN/+zLDQGbjrsQ/+mf5WdP89gNjQKSC8cTeK99Fuk+Hd9HkbMi0lf0clOZIg0GHHEmd6XLNgZrDr9x6mZwjlO+6XUF+M7O4WaDmmWoPOJqjaRU5k9taPrFXY4fBSVqqlhMu4F4R/MRGg/vLvLE7mMihazm2fpsoUmN2w/JZm6Cmfne4e9a2zbESZTJnjQTqXwfTaYLagpaJ/u/o6s4nSbAfeBxSit1mV54KylGt9lMqmviRu1KiPSQKBgQDzGoAfM7qnpE2dQVw5f2kmK/NaQhxYpJQ8A4PqCDQaHwr6R//LNu5RIWBpCNRENvjREhpFb2ovo5SqYk+sQHBkX080ARnbq4hk6ozBaOb5Mm3tJOCwMcEyn8kDL5zbWn7d9Eq/TIyVIDk1LGHvN+WPcZLU5uqyBz3W7iWkvUfLowKBgQCo2Ys99Zcxj3fo/zilF4hoVCC6dBWwTAW2HTI0XWSuZ8o6Qe0NlvZL1cM8U6pRBAXIiF1LWS5OzAiH7wPHgW1uiS/6pOoXSNSeXpOdVHcMCBCkBCuJYm2Rq6wzElLnBr7c7Q+LzRtailM6fXFba2sX54KWEsNXUBp4pdoMZe19vQKBgQDpZV/slPV3Tb9WYxHwAespwrh4x0//qsLGe3mCjy22hmc7szRaHfrf2XN+ZAOnGj/4ObEPSNBhvGNW0dw8PAGr2/VmsEfrJtxkRuusJNLcHRZ8vxMZFiuuNsn+TRADaPa0kX3R++Rcp/tEmb/Ms5WqChg2Xxykn183opxxdWggkQKBgEINyKEWgG1M+NXXcitzh1N5BcyrOQjc1KcnyMofdxGbXMtpmvjkA7orB9ODz28eKb0HS6f8XVdKDlRPNqVHhq3lUTW2ajVtsm+6A/laX6//P7NKRlXagY6pIBZiprfmNahrvNcuB/NlhaWuCTiAT0bstHNNJ8nydkiYaTLMdRnpAoGBAK+js/B8wHFnP0W7q7HNwFE19UW+S28dirXcBWGeMvfJojnU20rCH+OH+l/VkZ5MbSL731oajD1YMYlnnlMtFo4YmigNynl/3xEIQQixyo3gmTEeot/HDMf70u8JxEaCKezs76HH5bLwTSNtaHCgOgnEjKQhA13mEEIR6hAw/F4H";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key ="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0xCMoGD/qLggfC6ilozIyxyKEAIiiWXG+JsXfNh21Rtv+8y2iAmNIPurn8EIBdr3recZ4dS1dDILkEphRWE72G0qQITqQyinxykmsBALBm4GOhVu71BhQHTp3O+WqWbAf0OFUxssMbeOOxGlRNSLb0fyTyBCasoUTPO7Yqo40an9fBqYuWocULllaAmBh1WqAyBEWARRSpttIDgSeUnwvTCfTWWnzsi46R+9MFDzZ4eMG6B1wr5hG3F0If9oadCTPTX4xLMcWlZOPfF2qaR4Or6iIWirVLZaMnbBd2Sot8VMeK4CC4SqRA0G9EEevR9ScDau+NqdhYVnfm3KfvPCOwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8081/EasyBuy/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8080/EasyBuy/return_url.jsp";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";


    public static String log_path = "e:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
